package com.musifind.utils;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;

public class AppUtil {
	private static boolean development = false;

	private Context context;

	public AppUtil(Context context) {
		this.context = context;
	}

	public int getAppVersion() {
		try {
			PackageInfo packageInfo;
			packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
			return packageInfo.versionCode;
		} catch (PackageManager.NameNotFoundException e) {
			Log.d("AppUtil", "I never expected this! Going down, going down!" + e);
			throw new RuntimeException(e);
		}
	}

	public static boolean isDevelopment() {
		return development;
	}

}
